﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" 
Inherits="Nivdal.Finances" StylesheetTheme="SkinFile" Codebehind="Finances.aspx.cs" %>

<%@ Register Assembly="obout_Flyout2_NET" Namespace="OboutInc.Flyout2" TagPrefix="cc1" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="Manager office >> Finances" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="basic_element">
    <div class="red_title">
    </div>
    <div class="padding5">
    <table cellpadding="5" cellspacing="0">
        <tr>
            <td rowspan="4" >
                <asp:Image ID="EconomicsManImage" runat="server" ImageUrl="~/Images/Icons/Finance.png" ToolTip="<%$ Resources:Resource, Global_Finances %>"  />
            </td>
            <td >
                
                <asp:Label ID="CurrentBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_CurrentBalanceTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                
            </td>
            <td >
                <asp:Label ID="CurrentBalanceLabel" runat="server" SkinID="GreenLargeHeaderLabel"></asp:Label>
                <asp:Image ID="AtuksImage" runat="server" ImageUrl="~/Images/Icons/atuk.png" />
                <cc1:Flyout ID="Flyout1" runat="server" AttachTo="AtuksImage" FadingEffect="true">
                    <div class="ToolTipStyle">
                        <asp:Label ID="AtuksLabel" runat="server" Text="<%$ Resources:Resource, Atuks %>"></asp:Label>
                    </div>
                </cc1:Flyout>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="ThisWeekBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_ThisWeekBalanceTitleLabel %>"  SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Label ID="ThisWeekBalanceLabel" runat="server" Text="" SkinID="InfoLabel"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LastWeekBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_LastWeekBalanceTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Label ID="LastWeekBalanceLabel" runat="server" Text="" SkinID="InfoLabel"></asp:Label>
            </td>
        </tr> 
        <tr>
            <td>
                <asp:Label ID="MonthlyBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_MonthlyBalanceTitleLabel %>" SkinID="InfoLabel"></asp:Label>      
            </td>
            <td>
                <asp:Label ID="MonthlyBalanceLabel" runat="server" Text="" SkinID="InfoLabel"></asp:Label>     
            </td>
        </tr>    
    </table>
    <br /><br />
    <table style="width:100%; border-color:Black; border-style:solid; border-width:thin; border-collapse:collapse;" cellspacing="0" cellpadding="0">
        <tr style="height:34px;" >
            <td style="width:28%; background-color:#D4D4D4;border: solid 1px black; border-collapse:collapse;padding:5px 10px 5px 10px;">&nbsp;</td>
            <td style="text-align:center;width:24%; border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;" class="grid_header"  >
                <asp:Label ID="ThisWeekTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_ThisWeekTitleLabel %>" ></asp:Label>
            </td>
            <td style="text-align:center; width:24%;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;" class="grid_header" >
                <asp:Label ID="LastWeekTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_LastWeekTitleLabel %>" ></asp:Label>
            </td>
            <td style="text-align:center;width:24%;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;" class="grid_header"  >
                <asp:Label ID="LastMonthTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_LastMonthTitleLabel %>" ></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="padding-left:10px; padding-right:10px; border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="InitialBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_InitialBalanceTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="ThisWeekInitialBalanceLabel" runat="server" SkinID="SmallHeaderLabel"></asp:Label>
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="LastWeekInitialBalanceLabel" runat="server"  SkinID="SmallHeaderLabel"></asp:Label>
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="LastMonthInitialBalanceLabel" runat="server"  SkinID="SmallHeaderLabel"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="padding-left:10px; padding-right:10px; border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="FinalBalanceTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_FinalBalanceTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="ThisWeekFinalBalanceLabel" runat="server"  SkinID="SmallHeaderLabel"></asp:Label>    
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="LastWeekFinalBalanceLabel" runat="server"  SkinID="SmallHeaderLabel"></asp:Label>    
            </td>
            <td style="text-align:center;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <asp:Label ID="LastMonthFinalBalanceLabel" runat="server"  SkinID="SmallHeaderLabel"></asp:Label>    
            </td>
        </tr>
        <tr>
            <td style="border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">&nbsp;</td>
            <td style="padding-left:10px; padding-right:10px;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <div style="float:left; text-align:center;">
                    <asp:Label ID="ThisWeekIncomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Income %>"  SkinID="InfoLabel"></asp:Label>
                </div>
                <div style="float:right; text-align:center;">
                    <asp:Label ID="ThisWeekOutcomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_ThisWeekOutcomeTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                </div>
            </td>
            <td style="padding-left:10px; padding-right:10px;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <div style="float:left; text-align:center;">
                    <asp:Label ID="LastWeekIncomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Income %>" SkinID="InfoLabel"></asp:Label>
                </div>
                <div style="float:right; text-align:center;">
                    <asp:Label ID="LastWeekOutcomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_LastWeekOutcomeTitleLabel %>"  SkinID="InfoLabel"></asp:Label>
                </div>
            </td>
            <td style="padding-left:10px; padding-right:10px;border: solid thin black; border-collapse:collapse;padding:5px 10px 5px 10px;">
                <div style="float:left; text-align:center;">
                    <asp:Label ID="LastMonthIncomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Income %>" SkinID="InfoLabel"></asp:Label>
                </div>
                <div style="float:right; text-align:center;">
                    <asp:Label ID="LastMonthOutcomeTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_LastMonthOutcomeTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding:5px 10px 5px 10px; border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="IncomeFromCrowdTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_IncomeFromCrowdTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="IncomeFromSponsorsTitleTabel" runat="server" Text="<%$ Resources:Resource, Finances_IncomeFromSponsorsTitleTabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="IncomeFromSalesTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_IncomeFromSalesTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="IncomeOtherTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_IncomeOtherTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td style="padding:5px 10px 5px 10px; border: solid thin black; border-collapse:collapse;">
                <div style="float:left; text-align:center;">
                    <asp:Label ID="IncomeFromCrowdThisWeekLabel" runat="server"  SkinID="SmallHeaderLabel"  CssClass="finances_plus" ></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSponsorsThisWeekLabel" runat="server"  SkinID="SmallHeaderLabel"  CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSalesThisWeekLabel" runat="server"  SkinID="SmallHeaderLabel"  CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeOtherThisWeekLabel" runat="server"  SkinID="SmallHeaderLabel"  CssClass="finances_plus"></asp:Label>
                </div>
            </td>

            <td style="padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:left; text-align:center;">
                    <asp:Label ID="IncomeFromCrowdLastWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus" ></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSponsorsLastWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSalesLastWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeOtherLastWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                </div>
            </td>

            <td style="text-align:left; :5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:left; text-align:center">
                    <asp:Label ID="IncomeFromCrowdLastMonthLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus" ></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSponsorsLastMonthLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeFromSalesLastMonthLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                    <br /><br />
                    <asp:Label ID="IncomeOtherLastMonthLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="WagesTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_WagesTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="ArenaExpencesTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_ArenaExpencesTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="TotalPurchasesTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_TotalPurchasesTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <br /><br />
                <asp:Label ID="OtherExpencesTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_OtherExpencesTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>

            <td style="padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:right; text-align:center;">
                    <asp:Label ID="WagesThisWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="ArenaExpencesThisWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="TotalPurchasesThisWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>  
                    <br /> <br />
                    <asp:Label ID="OtherExpencesThisWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>  
                </div>
                
            </td>

            <td style="padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">   
                <div style="float:right; text-align:center;">
                    <asp:Label ID="WagesLastWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="ArenaExpencesLastWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="TotalPurchasesLastWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label> 
                    <br /> <br />
                    <asp:Label ID="OtherExpencesLastWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label> 
                </div>             
                
            </td>
            <td style="padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">   
                <div style="float:right; text-align:right;">
                    <asp:Label ID="WagesLastMonthLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="ArenaExpencesLastMonthLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="TotalPurchasesLastMonthLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
                    <br /> <br />
                    <asp:Label ID="OtherExpencesLastMonthLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>  
                </div>   
            </td>
        </tr>
        
        <tr>
            <td style="padding:5px 10px 5px 10px; border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="TotalTitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_TotalTitleLabel %>" SkinID="TeamNameLabel"></asp:Label>
            </td>
            <td style="text-align:center;padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:left;">
                    <asp:Label ID="TotalIncomeThisWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>  
                </div>
                <div style="float:right;">
                    <asp:Label ID="TotalOutcomeThisWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel"  CssClass="finances_minus"></asp:Label>  
                </div>
            </td>
            <td style="text-align:center;padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:left;">
                    <asp:Label ID="TotalIncomeLastWeekLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>  
                </div>
                <div style="float:right;">
                    <asp:Label ID="TotalOutcomeLastWeekLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>  
                </div>
            </td>
            <td style="text-align:center; padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <div style="float:left;">
                    <asp:Label ID="TotalIncomeLastMonthLabel" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>  
                </div>
                <div style="float:right;">
                    <asp:Label ID="TotalOutcomeLastMonthLabel" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>  
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding:5px 10px 5px 10px; border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="BalanceLabel" runat="server" Text="<%$ Resources:Resource, Finances_BalanceTitleLabel %>" SkinID="TeamNameLabel"></asp:Label>
            </td>
            <td style="text-align:center;padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="BalanceThisWeekLabelpositive" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus" ></asp:Label>
                <asp:Label ID="BalanceThisWeekLabelNegative" runat="server"  SkinID="SmallRedHeaderLabel"  CssClass="finances_minus"></asp:Label>
            </td>
            <td style="text-align:center;padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="BalanceLastWeekLabelpositive" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                <asp:Label ID="BalanceLastWeekLabelNegative" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
            </td>
            <td style="text-align:center;padding:5px 10px 5px 10px;border: solid thin black; border-collapse:collapse;">
                <asp:Label ID="BalanceLastMonthLabelpositive" runat="server"  SkinID="SmallHeaderLabel" CssClass="finances_plus"></asp:Label>
                <asp:Label ID="BalanceLastMonthLabelNegative" runat="server"  SkinID="SmallRedHeaderLabel" CssClass="finances_minus"></asp:Label>
            </td>

        </tr>
        
    
    </table>
    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="TotalWagesitleLabel" runat="server" Text="<%$ Resources:Resource, Finances_TotalWages %>" CssClass="white_title"></asp:Label>
        <asp:Label ID="TotalWagesLabel" runat="server" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
    
    
        <asp:GridView ID="WagesGridView" runat="server" AutoGenerateColumns="false" AllowPaging="false" DataSourceID="PlayerWagesdataSourse"
         SkinID="SimpleProfessional" OnRowDataBound="WagesGridViewRowDataBound" OnDataBound="WagesDataBound">
        <Columns>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Player %>">
                <HeaderStyle CssClass="CursorPointer" />
                <ItemTemplate>      
                    <asp:Label ID="PlayerSortLabel" runat="server" style="display:none;" Text='<%# WageSortString(Eval("ShirtNumber")) + Eval("PlayerName") %>'></asp:Label>
                    <asp:Label ID="ShirtNumberLabel" runat="server" Text='<%# Eval("ShirtNumber") + ". " %>' 
                    Visible='<%# Eval("ShirtNumber").ToString().Length > 0 %>' SkinID="GridLabel"></asp:Label>
                    <asp:HyperLink ID="FlagLink" runat="server" NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("CountryId") %>'
                     ImageUrl='<%# "~/Images/Flags/" + Eval("FlagImage") %>' ToolTip='<%# Eval("CountryName") %>'></asp:HyperLink>
                    <asp:HyperLink ID="PlayerHyperlink" runat="server" SkinID="GreenTitleHyperLink" Text='<%# Eval("PlayerName") %>'
                     NavigateUrl='<%# "~/Player.aspx?Id=" + Eval("PlayerId") %>' Visible='<%# !(bool)Eval("IsCoach") %>'></asp:HyperLink>
                     <asp:HyperLink ID="HyperLink1" runat="server" SkinID="GreenTitleHyperLink" Text='<%# Eval("PlayerName") %>'
                     NavigateUrl='<%# "~/coach.aspx?Id=" + Eval("PlayerId") %>' Visible='<%# Eval("IsCoach") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Player_WageTitleLabel %>">
                <HeaderStyle CssClass="CursorPointer" />
                <ItemTemplate>
                    <asp:Label ID="SortLabel" runat="server" Text='<%# WageSortString(Eval("Wage")) %>' style="display:none;"></asp:Label>
                    <asp:Label ID="WageLabel" runat="server" Text='<%# FormattedWage(Eval("Wage")) %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Player_ContractTill %>">
                <HeaderStyle CssClass="CursorPointer" />
                <ItemTemplate>
                    <asp:Label ID="contractTillSortLabel" runat="server" Text='<%# Eval("ConractTillRowData") %>' style="display:none;"></asp:Label>
                    <asp:Label ID="NextNegotioationsLabel" runat="server" Text='<%# Eval("ContractTill") %>' SkinID="GridLabel" ></asp:Label>
                </ItemTemplate>
            
            </asp:TemplateField>
        </Columns>
        </asp:GridView>
    </div>
    </div>
    

    <asp:SqlDataSource ID="PlayerWagesdataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetTeamPlayeWages" SelectCommandType="StoredProcedure"></asp:SqlDataSource> 
</asp:Content>
<asp:Content ContentPlaceHolderID="HeadPlaceHolder" ID="HeadPlaceHolder" runat="server">
    <script language="javascript" type="text/javascript">

        $(function () {
            $("#ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_WagesGridView").tablesorter(
//                { cssHeader: "NheaderNoSort" },
//                { cssAsc: "NheaderSortUp" },
//                { cssDesc: "NheaderSortDown" }
            );
        })
        

    </script>
</asp:Content>

